package com.man.LogicService;

import com.man.bean.People;
import com.man.dao.PeopleDao;

public class addService {
    public static String authenticateUser(String account,String name,String sex,String pro,String cls){
        People people=new People(account,name,sex,pro,cls);

        if(account.equals("")){
            return "员工号不能为空";
        } else if (name.equals("")) {
            return "姓名不能为空";
        } else if (sex.equals("")) {
            return "性别不能为空";
        } else if (pro.equals("")) {
            return "职位不能为空";
        } else if (cls.equals("")) {
            return "联系方式不能为空";
        }
        int num = new PeopleDao().savePeople(people);
        if(num == 0){
            return "员工号重复";
        }
        return "添加成功";
    }
}
